package com.song.controller.user;

import com.song.dto.OrdersSubmitDTO;
import com.song.result.Result;
import com.song.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController("user-OrderController")
@RequestMapping("/user/order")
public class OrderController {
    @Autowired
    private OrderService orderService;
    // 用户下单
    @PostMapping("/submit")
    public Result submitOrder(@RequestBody OrdersSubmitDTO ordersSubmitDTO) {
        log.info("用户下单接口，参数{}", ordersSubmitDTO);
        orderService.submitOrder(ordersSubmitDTO);
        return Result.success();
    }
}
